package com.kemal.Mapdeneme;

import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

import android.content.ContentResolver;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;

public class ShareOnFacebook 
{
	public void share()
	{
//		Bundle parameters = new Bundle(); 
//		parameters.putString("message", "Test Photo"); 
//		parameters.putString("attachment", "{\"name\":\"My Test Image\"," 
//		+"\"href\":\""+"http://www.google.com"+"\"," 
//		+"\"media\":[{\"type\":\"image\",\"src\":\""+"http://www.google.com/logos/mucha10-hp.jpg"+"\",\"href\":\""+"http://www.google.com"+"\"}]" 
//		+"}"); 
//		facebookClient.dialog(this, "stream.publish", parameters, this); 
//		
//		//___________________________________________________________________________
//		
//		
//		byte[] data = null; 
//		try { 
//		    ContentResolver cr = mainActivity.getContentResolver(); 
//		    InputStream fis = cr.openInputStream(localSnapshotUri); 
//		    Bitmap bi = BitmapFactory.decodeStream(fis); 
//		    ByteArrayOutputStream baos = new ByteArrayOutputStream(); 
//		    bi.compress(Bitmap.CompressFormat.JPEG, 100, baos); 
//		    data = baos.toByteArray();               
//		} catch (FileNotFoundException e) { 
//		    e.printStackTrace(); 
//		}      
//		 
//		Bundle params = new Bundle();  
//		params.putString("method", "photos.upload");           
//		params.putByteArray("picture", data); 
//		 
//		AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook); 
//		mAsyncRunner.request(null, params, "POST", new SampleUploadListener()); 
		
		//-----------------------------------------------------------------------------
		
		
//		Intent sharingIntent = new Intent(Intent.ACTION_SEND);
//		Uri screenshotUri = Uri.parse(path);
//		sharingIntent.setType("image/png");
//		sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
//		startActivity(Intent.createChooser(sharingIntent, "Share image using"));
	}

}
